﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using CW.Component.Data;
using CW.Demo.Core.Models.Account;

namespace CW.Demo.Core.Data.Configurations
{
    public abstract class BaseConfiguration<T> : EntityTypeConfiguration<T>, IEntityMapper where T : class
    {
         /// <summary>
        /// 实体类-数据表映射构造函数——用户扩展信息
        /// </summary>
        public BaseConfiguration()
        {
            ExtendConfigurationAppend();
        }
		
        /// <summary>
        /// 额外的数据映射
        /// </summary>
        public abstract void ExtendConfigurationAppend();

        /// <summary>
        /// 将当前实体映射对象注册到当前数据访问上下文实体映射配置注册器中
        /// </summary>
        /// <param name="configurations">实体映射配置注册器</param>
        public void RegistTo(System.Data.Entity.ModelConfiguration.Configuration.ConfigurationRegistrar configurations)
        {
            configurations.Add(this);
        }
    }
}
